home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / p063b9s.zip / UNIT / AREAMAN.PAS < prev    next >
Pascal/Delphi Source File  |  1997-03-02  |  3KB  |  103 lines

  1. UNIT AreaMan;
  2. {╔══════════════════════════════════════════════════════════════════════════╗}
  3. {║ File areamanager                              Last changed: 02.03.97  SA ║}
  4. {║                                                                          ║}
  5. {║                         (C) Copyright 1989-97 by                         ║}
  6. {║       Dan Wulff, Jens Sandalgaard, Steen Christensen & S¢ren Ager        ║}
  7. {║                                                                          ║}
  8. {║ This source may not be given to anybody, without the written permission  ║}
  9. {║ from The Portal Team.                                                    ║}
  10. {╚══════════════════════════════════════════════════════════════════════════╝}
  11. {$I POPDEFS.INC}
  12.  
  13. INTERFACE
  14.  
  15. USES Use32, Globals;
  16.  
  17. VAR
  18.   Area        : AreaTabPtr;
  19.   NumArea     : Integer;
  20.  
  21. PROCEDURE AreaManager;
  22.  
  23. IMPLEMENTATION
  24.  
  25. USES Dos, OpCrt, OpString,
  26.      StrUtil, Display, Input, Keyboard, InterCom, OproUtil, Util, MailUtil,
  27.      LogFile, NodeList, AreaMisc, AMList, AMFBBS, AMRA2, PopTypes;
  28.  
  29.   Procedure ProcessFDB;
  30.   VAR
  31.    AM : ^RaList;
  32.   Begin
  33.     NEW(Am,Init);
  34.     IF Am<>NIL THEN
  35.     BEGIN
  36.       IF NumArea=0 THEN
  37.       BEGIN
  38.         Topic:=52;
  39.         MyWin(Am^.Temp,3,8,77,11,3,'ERROR',False);
  40.         WITH Am^.Temp^ DO
  41.         BEGIN
  42.           wFastWrite('NO Areas found - Be sure to have defined BBSType & BBSPath properly in',
  43.                      1,2,cfg.color[3].TextColor);
  44.           wFastWrite('your PORTAL configuration. Hit ANY KEY to continue',2,2,cfg.color[3].TextColor);
  45.           PopReadKeyWord;
  46.         END;
  47.         KillWindow(Am^.Temp);
  48.       END ELSE
  49.         am^.AreaManagerMain;
  50.       Dispose(AM, Done);
  51.     END ELSE
  52.       AddLog('!', 'Not enough memory to initialize Area Manager');
  53.   END;
  54.  
  55.   Procedure ProcessFilesBBS;
  56.   VAR
  57.    AM : ^FilesbbsType;
  58.   Begin
  59.     NEW(Am,Init);
  60.     IF Am<>NIL THEN
  61.     BEGIN
  62.       IF NumArea=0 THEN
  63.       BEGIN
  64.         Topic:=52;
  65.         MyWin(Am^.Temp,3,8,77,11,3,'ERROR',False);
  66.         WITH Am^.Temp^ DO
  67.         BEGIN
  68.           wFastWrite('NO Areas found - Be sure to have defined BBSType & BBSPath properly in',
  69.                      1,2,cfg.color[3].TextColor);
  70.           wFastWrite('your PORTAL configuration. Hit ANY KEY to continue',2,2,cfg.color[3].TextColor);
  71.           PopReadKeyWord;
  72.         END;
  73.         KillWindow(Am^.Temp);
  74.       END ELSE
  75.         am^.AreaManagerMain;
  76.       am^.Done;
  77.       Dispose(AM);
  78.     END ELSE
  79.       AddLog('!', 'Not enough memory to initialize Area Manager');
  80.   End;
  81.  
  82.   Procedure Areamanager;
  83.   BEGIN
  84. {$IFNDEF PoPLite}
  85.     FillChar(Call, SizeOf(Call), 0);
  86.     IF Not SetInterCom(ICAreaMan,Call,True) THEN Exit;
  87.     FreeUpMemory;
  88.     New(Area);
  89.     NumArea:=ReadFileAreas(Area);
  90.     IF Fdbpath<>''THEN { hvis Ra2.x }
  91.       ProcessFDB
  92.     ELSE
  93.       ProcessfilesBBS;
  94.     DisposeFileAreas(Area,NumArea);
  95.     Dispose(Area);
  96.     Initialisenodelist(cfg.NodeList,cfg.nodelisttyp);
  97. {$ELSE}
  98.     AskError(10, 'Not implemented in Portal of Power/Lite', 2);
  99. {$ENDIF}
  100.   END;
  101.  
  102. END.
  103.